#pragma once
#include <Windows.h>
#include <fmod.hpp>
#include "Vector.hpp"
#include "Usefuls.h"

class Sound
{
private:
	Sound();
	FMOD::System*			system;
	Vector<FMOD::Sound*>	vEffects;
	Vector<FMOD::Sound*>	vStreams;
	FMOD::Channel*			myChannel;


	FMOD_CAPS			caps;
	FMOD_RESULT			result;
	FMOD_SPEAKERMODE	speakermode;

	bool SoundStreaming;

	int					numdrivers;
	unsigned int		version;
	char				name[256];

public:
	inline static Sound* Engine()      
	{	static Sound s; return &s;	}

	bool Init();
	bool Init(Vector<char*> effects, Vector<char*> streams);
	void LoadEffect(char* filename);
	void LoadStream(char* filename);
	void PlayEffect(int index);
	void Stream(int index);
	void DoWork();
	~Sound();
};

